[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
##############################################################################
###+-----------+##############################################################
#+-| I_TRUNC() |----------------------------------+###########################
#| +-----------+ Truncates argument to an integer |###########################
#+------------------------------------------------+###########################
##############################################################################
##############################################################################
#+--| Summary |--------------+################################################
#|     #INCLUDE math.hdr     |################################################
#+---------------------------+################################################
##############################################################################
##############################################################################
#+--| Syntax |----------------------------+###################################
#|     FUNCTION INT i_trunc PROTOTYPE     |###################################
#|      PARAMETERS CONST DBL argument     |###################################
#+----------------------------------------+###################################
##############################################################################
##############################################################################
#########+---| Description |---------------------------------------+##########
#########| The i_trunc() function truncates argument to an integer |##########
#########| and returns the integer as INT.  (This is the same as   |##########
#########| implicit DBL-to-INT conversion.)                        |##########
#########+---------------------------------------------------------+##########
##############################################################################
##############################################################################
#########+---| Design |---------------------------------------------+#########
#########| The i_trunc() function exists to allow the development   |#########
#########| of "Warning-less" code.  The FORCE compiler issues a     |#########
#########| WARNING whenever a loss of precision occurs (i.e., going |#########
#########| from a double-precision number to an integer).  The      |#########
#########| WARNING itself is harmless and exists to ALERT you to a  |#########
#########| condition which COULD be an error.  see error codes,     |#########
#########| for more information.                                    |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########|                                                          |#########
#########| ? i_trunc( 10.1 )                                        |#########
#########| ? i_trunc( 10.45 )                                       |#########
#########| ? i_trunc( 10.95 )                                       |#########
#########| ? i_trunc( 934.2224 )                                    |#########
#########+----------------------------------------------------------+#########
##############################################################################

See Also: i_round() round() trunc()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson